{% if has_logged_in %}
<strong> {{ user.name }} </strong>
<a href="{% url 'weibo:logout' %}"> log out </a>
{% else %}
<a href="{% url 'weibo:register_html' %}"> register </a>
&nbsp
<a href="{% url 'weibo:login_html' %}"> login </a>
{% endif %}

{% for each_message in current_page %}
<div> {{ each_message.text }} </div>
<strong> {{ each_message.author.name }} &nbsp
		{{ each_message.published_time }} </strong>
{% endfor %}

<br/>
<a href="{% url 'weibo:index' %}"> home page </a>&nbsp
{% if current_page.has_previous %}
<a href="?page={{ current_page.previous_page_number }}"> last page </a>
&nbsp
{% endif %}
<span> {{current_page.number}} </span>
{% if current_page.has_next %}
<a href="?page={{ current_page.next_page_number }}"> next page </a>
&nbsp
{% endif %}
<a href="?page={{ current_page.paginator.num_pages }}"> end page </a>

<form method="POST" action="{% url 'weibo:addmessage' %}">
{% csrf_token %}
<h4> text </h4>
<input type="text" name="message">
<input type="submit" />
</form>
